<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../../js库/mock.js"></script>
    <script src="../../js库/vue.js"></script>
    <title></title>
    <style>
    </style>
</head>
 <style>
    div {
        background-color: gray;
        width: 300px;
    }
    a {
        text-decoration: none;
        height: 30px;
        color: rgba(255, 255, 255, 0.634);
        display: block;
       text-indent: 2em;
      line-height: 30px;
      
    }
    a:hover {
        background-color: orange;
    }
    a:visited {
       color: blue;
    }
    /* 单行文字垂直居中
        让文本行高等于盒子的高度
             line-height =  height
    */
 </style>
<body>
    <div id="root">
        <a v-for="(li,index) in list" target="_blank" :key="index" :href=`${index}'http://www.baidu.com/'`>{{li}}</a>
    </div>
</body>
<script>
    new Vue({
        el: '#root',
        data() {
            return {
                list:[
                    "手机 电话卡",
                    "电视 盒子",
                    "笔记本 平板",
                    "出行 穿戴",
                    "智能 路由器",
                    "健康 儿童",
                    "耳机 音响"
                ]
            }
        },
    })
</script>

</html>